package ru.spies.work;

import javax.servlet.http.HttpServletRequest;

import ru.spies.forms.EDBTables;

public abstract class AbstractWork {
	
	public void  doWork(HttpServletRequest request, EDBTables lastTable){
		switch (lastTable) {
		case AGENT:
			doWorkWithAgent(request);
			break;
		case AGENT_AND_TASK:
			doWorkWithAgentAndTask(request);
			break;
		case COUNTRY:
			doWorkWithCountry(request);
			break;
		case DEPARTMENT:
			doWorkWithDepartment(request);
			break;
		case DOCUMENT:
			doWorkWithDocument(request);
			break;
		case IMPORTANCE:
			doWorkWithImportance(request);
			break;
		case TASK:
			doWorkWithTask(request);
			break;
		case TASK_TYPE:
			doWorkWithTaskType(request);
			break;	
		default:
			return;
		}
	}

	protected abstract void doWorkWithAgent(HttpServletRequest request);
	protected abstract void doWorkWithAgentAndTask(HttpServletRequest request);
	protected abstract void doWorkWithCountry(HttpServletRequest request);
	protected abstract void doWorkWithDepartment(HttpServletRequest request);
	protected abstract void doWorkWithDocument(HttpServletRequest request);
	protected abstract void doWorkWithImportance(HttpServletRequest request);
	protected abstract void doWorkWithTask(HttpServletRequest request);
	protected abstract void doWorkWithTaskType(HttpServletRequest request);	

}
